import os
'''
需求： 代码在任意路径都可以获取到项目的绝对路径

'''

# print(__file__)  #获取该文件的文件路径
# print(os.path.dirname(__file__))
# print(os.path.dirname(os.path.dirname(__file__)))
project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))  #工程路径
# C:/Users/86185/Desktop/file/api_-auto/utils/handle_path.py
# C:/Users/86185/Desktop/file/api_-auto/utils
# C:/Users/86185/Desktop/file/api_-auto
# C:\Users\86185\Desktop\file\api_-auto

# 2 - 配置路径
# project_path1= os.path.dirname((os.path.abspath(__file__)))
report_path = os.path.join(project_path,r"report\tmp")
# #C:\Users\86185\Desktop\file\api_-auto\configtt
print(report_path)

# 3 - 测试路径
testData_path = os.path.join(project_path,'data')
print(testData_path)
excelDir = os.path.join(testData_path, 'res.xls')
# print(excelDir)

config_path = os.path.join(project_path,'configtt')
print(config_path)